//
//  Utils.h
//  CarOnlineConsult
//
//  Created by 黄卫 on 17/2/24.
//  Copyright © 2017年 huangwei. All rights reserved.
//

#import <Foundation/Foundation.h>

#define CHINESE @"zh-Hans"
#define ENGLISH @"en"
#define GDLocalizedString(key,comment) [[GDLocalizableController bundle] localizedStringForKey:(key) value:@"" table:nil]

@interface Utils : NSObject

+ (NSString *)md5:(NSString *)str;

+(BOOL)CheckPhoneNumInput:(NSString *)_text;

#pragma 正则匹配用户密码6-20位数字和字母组合
+ (BOOL)checkPassword:(NSString *) password;

+ (BOOL)VerityContentWithString:(NSString *)content;

#pragma mark 数字
+(BOOL)CheckNumber:(NSString *)number;

#pragma mark 邮箱
+(BOOL)CheckEmail:(NSString *)email;

#pragma mark 中文字符
+(BOOL)CheckChinese :(NSString *)chinese;

#pragma mark 邮编
+(BOOL)CheckPost:(NSString *)post;

#pragma mark IP 地址
+(BOOL)CheckIP:(NSString *)ip;

#pragma mark 日期格式
+(BOOL)CheckDate:(NSString *)date;

#pragma mark QQ号码
+(BOOL)CheckQQ:(NSString *)qq;

#pragma mark 电话号码
+(BOOL)CheckTelephone:(NSString *)telephone;

#pragma mark 手机号
+(BOOL)CheckPhone:(NSString *)phone;

#pragma mark 字母
+(BOOL)CheckLetter:(NSString *)letter;

#pragma mark 身份证号码
+(BOOL)CheckIdCard:(NSString *)idCard;

#pragma mark URL
+(BOOL)CheckUrl:(NSString *)url;

#pragma mark 是否有中文
+(BOOL)CheckContainChinese :(NSString *)chinese;

+(NSBundle *)bundle;//获取当前资源文件

+(NSString *)userLanguage;//获取应用当前语言

+(void)setUserlanguage:(NSString *)language;//设置当前语言

+(UIImage *)createImageWithColor:(UIColor *)color imageSize:(CGSize)size;

//+(BOOL)filteSpecialChar:(NSString *)str;/**过滤特殊字符*/

/**
 *  获取应用版本号
 */
+ (NSString*)currentVersion;

/**
 *  字典转json
 */
+ (NSString*)dictionaryToJson:(NSDictionary *)dic;

/**
 *  格式化价格,是小数就保留两位, 不是小数就取整数
 */
+ (NSString *)formatPriceValue:(CGFloat)originValue;

/**
 *  产生随机颜色
 */
+ (UIColor *)randomColor;

@end
